
#include "stdio.h"
#include "string.h"
#define N 24000

int answer[N]={0};
int ba[9][4]={{0,0,0,0},
		     {0,1,2,5},
		     {0,2,5,0},
		     {0,3,7,5},
		     {0,5,0,0},
		     {0,6,2,5},
		     {0,7,5,0},
		     {0,8,7,5},
		     {1,0,0,0}};



void di(int n,int a,int site)
{
      int i,j;
      a--;
      if (n)
      {

			if (a==0)
			{

				for (i=0;i<=3;i++)
				{
					j=site+i;
					answer[j]+=ba[n][i];
					answer[j-1]+=answer[j]/10;
					answer[j]%=10;

					while (answer[j-1]>=10)
					{
						answer[j-2]+=answer[j-1]/10;
						answer[j-1]%=10;
						j--;
					}
					

				}
			}
			else
			{
				di(ba[n][0],a,site);
				di(ba[n][1],a,site+1);
				di(ba[n][2],a,site+2);
				di(ba[n][3],a,site+3);
			}
      }

}



void main()
{
	char shu[8000];

	int i,n,len;


	while (scanf("%s",shu)!=EOF)
	{

		len=strlen(shu);
	    if (len==1)
	    {
			if (shu[0]=='0') printf("%s [8] = 0 [10]\n",shu);
			else printf("%s [8] = 1 [10]\n",shu);

	    }
	    else
	    {
			for (i=0;i<N;i++) answer[i]=0;
			for (i=2;i<len;i++)
			{
				n=shu[i]-'0';
				di(n,i-1,1);
			}

			len=N-1;
			while (answer[len]==0) len--;


			printf("%s [8] = 0.",shu);

			for (i=2;i<=len;i++) printf("%d",answer[i]);
			printf(" [10]\n");
	    }
	}// end of while 


}